package com.dai.service;

import com.dai.mapper.BookMapper;
import com.dai.pojo.Books;
import lombok.Lombok;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public class BookServiceImpl implements BookService{

    //Service调用mapper层，组合
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper){
        this.bookMapper=bookMapper;
    }


    @Override
    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    @Override
    public int deleteBook(int id) {
        return bookMapper.deleteBook(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBooks() {
        return bookMapper.queryAllBooks();
    }

    @Override
    public Books queryBookName(String name) {
        return bookMapper.queryBookName(name);
    }
}
